package com.balance.mapper.sys;

import com.balance.pojo.sys.SysUser;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @Title: SysUserMapper
 * @Author 小东
 * @Package com.balance.mapper
 * @Date 2025/3/27 17:40
 * @description: 系统用户持久层
 */
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {
    /**
     * 获取全部数据 or 检索条件查询
     * @param sysUser
     * @return
     */
    public List<SysUser> getAll(SysUser sysUser);

    /**
     * 根据ID查询对应信息
     * @param id
     * @return
     */
    public SysUser getUserById(Integer id);

    // 动态查询用户列表
    SysUser selectUserAndRoleList(Map<String, Object> params);

    // 新增用户
    int insertUser(SysUser user);

    // 更新用户
    int updateUser(SysUser user);

    // 删除用户
    int deleteUserById(Long id);

    @Override
    default SysUser selectOne(Wrapper<SysUser> queryWrapper) {
        return BaseMapper.super.selectOne(queryWrapper);
    }
}
